feat: migrate from Wails v2 to v3 - #44
Merged
Merged
Conversation
…ils v2 imports - Migrate exec, logs, metric, networker, settings, data, ui, utils, devserver, diagnostics - Delete 7 client wrapper files - Convert dialog calls in installer.go to v3 builder pattern - Update main.go service registration with interface wrappers - Zero wails/v2 imports remaining in Go codebase
… API - Update 22 source files and 4 test files - EventsOn → Events.On with event.data unwrapping - EventsOff → Events.Off - BrowserOpenURL → Browser.OpenURL - Update imports from wailsjs/runtime to @wailsio/runtime or @omniviewdev/runtime/runtime
- Generate v3 bindings to packages/omniviewdev-runtime/src/bindings/ - Update all hook imports from wailsjs/go/ to v3 binding paths - Remove all namespace patterns (types.Connection -> Connection) - Update WatchState enum to v3 member names - Delete old wailsjs/ directory - Update Taskfile binding generation to output to correct location - Update api.ts and models.ts to re-export v3 bindings
- Wrap multi-arg Emit calls in struct payloads (UpdatePayload, UpdateErrorPayload, DevServerErrorPayload) - Add typed event registration for update events - Restore CreateTerminal method on exec controller (wraps CreateSession with TTY) - Fix frontend tuple destructuring to use struct payload fields - Regenerate v3 bindings (222 methods, 28 enums, 118 models)
- Replace PluginManagerService interface embedding with explicit method delegation (excludes SetDevServerChecker, SetPluginLogManager, HandlePluginCrash) - Create PluginLogService wrapper exposing only frontend-safe methods (excludes OnEmit/EmitFunc, Stream, Close, LogDir) - Create DevServerService wrapper to prevent service/model type shadowing - Update api.ts and models.ts for new binding file names - Binding warnings reduced from 7 to 3 (remaining are transitive SDK types)
…all service wrappers All controller service wrappers now use explicit method delegation instead of interface embedding. This ensures the binding generator only discovers frontend-safe methods and eliminates all 7 binding warnings: - PluginManagerService: 22 frontend methods, excludes SetDevServerChecker/etc - ResourceControllerService: 45 methods, excludes OnPlugin*/Run/SetCrashCallback - ExecControllerService: 14 methods, excludes plugin lifecycle - LogsControllerService: 9 methods - MetricControllerService: 8 methods - NetworkerControllerService: 9 methods - SettingsControllerService: 8 methods - DataControllerService: 4 methods - SettingsProviderService: 19 methods, excludes Initialize/RegisterChangeHandler - PluginLogService: 5 methods, excludes OnEmit/Stream/Close - DevServerService: 12 methods, separates service from model type Binding generation: 0 warnings, 16 services, 174 methods, 28 enums, 110 models
- Replace map[string]interface{} with ConnectionStatusPayload for connection/status
- Register connection/status, watch/STATE, plugin/process/log, menu events via RegisterEvent[T]
- Add event constants for all menu events
- Import eventcreate.ts and reference eventdata.d.ts in runtime.ts for type augmentation
- 32 fully typed events in CustomEvents interface (was 23)
- Update test assertions to use typed payloads
- Remove unnecessary `as` casts where CustomEvents provides proper types - Add null guards for v3 binding return types (T | null) - Fix CancellablePromise/TanStack Query type mismatch in useResourceMetrics - Handle optional map values in useWatchState and useConnectionStatus - Runtime package typecheck: 0 errors
- Root Taskfile: dev task just calls wails3 dev (no manual build/run) - darwin Taskfile: proper build:native with DEV flag, correct run task with APP_NAME in paths - linux/windows Taskfiles: simplified to match scaffold pattern - build/Taskfile.yml: proper deps chain (install:frontend:deps, generate:bindings, build:frontend) - config.yml dev_mode.executes drives the dev lifecycle automatically
build:dev does a non-minified development vite build, needed because the Go binary embeds dist/ even in dev mode while Vite dev server provides hot reload on the side.
…ugin loading Controllers must receive ctx from ServiceStartup BEFORE the bootstrap service calls pluginManager.Initialize(), which triggers OnPluginStart on all controllers. Without ctx, gRPC stream creation panics with nil pointer dereference. Follows Wails v3 documented pattern: 'The context will be valid as long as the application is running, and will be cancelled right before shutdown.'
- Replace babel config with @rolldown/plugin-babel + reactCompilerPreset - Update @vitejs/plugin-react to v6 - Install @rolldown/plugin-babel - Eliminates esbuild/optimizeDeps deprecation warnings
- Delete packages/omniviewdev-providers/internal/runtime/ (legacy v2 wailsjs wrapper) - Update providers index.ts to re-export from @wailsio/runtime directly - Update portforward hooks to use Browser.OpenURL instead of BrowserOpenURL - Add dist/.gitkeep for go:embed directive on fresh clones - Add @wailsio/runtime dependency to providers package
…ing down the IDE - HomepageCard: wrap plugin component in ErrorBoundary with InlineErrorFallback so a single card crash shows an inline error with retry, not a full-page crash - LinkedResourceDrawer: wrap sidebar component in ErrorBoundary so plugin sidebar crashes don't block the entire drawer Both use resetKeys tied to the specific plugin/resource so retries are scoped.
Wails v3's asset server proxy doesn't support WebSocket upgrades, so HMR module updates can't flow through it. Configure the HMR client to connect directly to localhost:9245 via ws:// protocol, bypassing the Wails proxy while keeping module fetches proxied.
The scaffold has zero server config. wails3 dev handles port assignment via CLI flags and WAILS_VITE_PORT env var. Our custom server block with host/port/strictPort/hmr was overriding Vite's defaults and breaking the HMR connection through the Wails webview proxy.
…#3064 The Wails webview loads from wails.localhost which can't resolve WebSocket connections. The confirmed fix from the community is to set server.hmr.host='localhost' and server.hmr.protocol='ws' so the HMR client connects directly to the Vite dev server bypassing wails.localhost.
The Wails v3 asset server returns 501 for WebSocket upgrade requests, preventing Vite HMR from connecting through the proxy. Use a separate port (9246) for the HMR WebSocket so the webview connects directly to Vite, bypassing the asset server entirely.
http.FileServerFS always serves from embedded dist/ assets, completely bypassing the Wails dev server proxy. application.AssetFileServerFS checks FRONTEND_DEVSERVER_URL and proxies to the Vite dev server in dev mode, serving live content with HMR support. This is why: - import.meta.env.DEV was false (serving production build) - HMR client was never injected - Dev mode indicator was missing from footer
The separate HMR port (9246) was a workaround for when the webview was loading from embedded dist/ assets. Now that AssetFileServerFS proxies to Vite in dev mode, HMR works natively through the proxy. Only keep hmr.host=localhost and hmr.protocol=ws per wailsapp/wails#3064.
- Add Server options (localhost:34115) to application.Options for headless HTTP server mode (built with -tags server) - Add build:server and run:server tasks to Taskfile - Update Playwright config to use run:server with /health endpoint - Server mode serves the same app without native GUI dependencies, suitable for CI/CD testing
- Add ServerOptions (port 34115) to application.Options - Playwright config targets server mode at localhost:34115 - Server mode tasks commented out — blocked by Wails v3 alpha.74 macOS build tag conflict (darwin files don't exclude server tag) - E2E tests can run in CI on Linux where server mode works - TODO: uncomment server tasks when Wails fixes upstream
|
Important Review skippedToo many files! This PR contains 269 files, which is 119 over the limit of 150. ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (269)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- pr.yml: task + wails3 for builds and E2E (server mode on Linux) - nightly.yaml: task + wails3 for all 3 platform builds, Go 1.24→1.26 - release.yaml: task + wails3 for all 3 platform builds - All: output paths updated from build/bin/ to bin/ - All: wails build replaced with task common:build:frontend + go build
Match Wails v3 CI (build-and-test-v3.yml): libgtk-3-dev libwebkit2gtk-4.1-dev libwayland-dev build-essential pkg-config. Use awalsh128/cache-apt-pkgs-action for caching across runs.
… limit - E2E job disabled with if:false until Wails v3 fixes BrowserWindow.AttachModal - Add repo-token to all arduino/setup-task calls to prevent GitHub API rate limiting
- Add .app bundle creation step (Contents/MacOS + Resources + Info.plist) - Sign and notarize the .app bundle, not the bare binary - DMG references Omniview.app instead of bare Omniview - Add CGO/MACOSX_DEPLOYMENT_TARGET env vars for macOS builds - PR artifacts zip the .app bundle
Info.plist had Go template placeholders ({{.Name}}, {{.Info.ProductVersion}})
from the v2 era. Ran wails3 update:build-assets to render actual values.
Also removed stale CFBundleURLTypes with unrendered template vars.
Critical: - UI ServiceWrapper: replace struct embedding with explicit delegation, excluding OnPluginInit/Start/Stop/Shutdown/Destroy from frontend Important: - PluginAssetHandler: replace panic with 500 response on UserHomeDir failure - PluginAssetHandler: compile regex once at package level, not per request - Main window: add UseApplicationMenu: true for Windows/Linux menu support - Wire SetupKeyBindings and SetupContextMenus (were defined but never called)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Complete migration of Omniview from Wails v2 (v2.11.0) to Wails v3 (alpha.74).
Backend
Frontend
Build System
Known Items
Test plan